import request from '@/utils/request'

export function createTag(data) {
  return request({
    url: '/tags',
    method: 'post',
    data
  })
}

export function getTagsByPagination(currentPage, pageSize) {
  return request({
    url: '/tags',
    method: 'get',
    params: { 'page': currentPage, 'page_size': pageSize }
  })
}

export function editTagByID(data) {
  return request({
    url: '/tags/' + data['id'],
    method: 'put',
    data
  })
}

export function deleteTagByID(id) {
  return request({
    url: '/tags/' + id,
    method: 'delete'
  })
}

export function getTagBySearchText(text) {
  return request({
    url: '/tags/query/' + text,
    method: 'get'
  })
}
